<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SpringMVC_demo</title>
<link rel="stylesheet" href="<%=path %>/css/reveal.css">
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery.reveal.js"></script>
<style>
body { font-family: "HelveticaNeue","Helvetica-Neue", "Helvetica", "Arial", sans-serif; }
.big-link { display:block; margin-top: 100px; text-align: center; font-size: 70px; color: #06f; }
</style>

<script type="text/javascript">
function login(){
	var userName = $("#userName").val();
	var password = $("#password").val();
	
	if(userName == ''){
		alert("用户名不能为空！");
		return;
	}else if(password == ''){
		alert("密码不能为空！");
		return;
	}else{
		$.ajax({
			async: false,
	        type: "POST",
	        cache: false,
	        url: "<%=path %>/common/login.do",
	        dataType: "json",
	        data: "userName="+userName+"&password="+password,
	        timeout: 5000,
	        global: false,
	        success: function (data){
	    		var user = data.userInfo;
	        	if(null != user){
	        		$("#loginForm").submit();
	        	}else{
	        		alert("用户名或密码错误！");
	        	}
	        },
			error:function(){
				alert("系统异常，联系管理员！");
			}
	    });
	}
}
</script>
</head>
<body>
	<img src="<%=path %>/images/background.gif" width="100%" height="100%" alt="点击任意开登录" title="点击任意开始登录" data-reveal-id="myModal">
	<div id="myModal" class="reveal-modal">
		<form id="loginForm" action="<%=path %>/common/toMain.do" method="POST">
		<table id="__01" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td colspan="4">
					<img src="<%=path %>/images/2_01.jpg" width="334" height="63" alt=""></td>
			</tr>
			<tr>
				<td rowspan="6">
					<img src="<%=path %>/images/2_02.jpg" width="33" height="254" alt=""></td>
				<td colspan="2">
					<input type="text" id="userName" name="userName" style="background-image: url('<%=path %>/images/2_03.jpg'); width: 263px; height: 42px; border: 0px;" />
				</td>
				<td rowspan="6">
					<img src="<%=path %>/images/2_04.jpg" width="36" height="254" alt=""></td>
			</tr>
			<tr>
				<td colspan="2">
					<img src="<%=path %>/images/2_05.jpg" width="265" height="44" alt=""></td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="password" id="password" name="password" style="background-image: url('<%=path %>/images/2_06.jpg'); width: 263px; height: 46px; border: 0px;" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<img src="<%=path %>/images/2_07.jpg" width="265" height="51" alt=""></td>
			</tr>
			<tr>
				<td rowspan="2">
					<img src="<%=path %>/images/2_08.jpg" width="170" height="67" alt=""></td>
				<td>
					<input name="login" type="image" value="" src="<%=path %>/images/2_09.jpg" onclick="login();" />
				</td>
			</tr>
			<tr>
				<td>
					<img src="<%=path %>/images/2_10.jpg" width="95" height="30" alt=""></td>
			</tr>
		</table>
		</form>
	</div>
</body>
</html>

